<template>
  <div class="metro">
    <van-nav-bar title="城市地铁" left-text="返回" left-arrow @click-left="back" />

    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
    <van-swipe-item v-for="item in list" :key="item.id" >

      <img :src="'http://124.93.196.45:10001/'+item.advImg" />

      </van-swipe-item>
  </van-swipe>

  <ul>
    <li @click="opinion">
        <div class="iconfont icon-yijianfankui"></div>
        <div>意见反馈</div>
    </li>
    <li @click="info">
        <div class="iconfont icon-24gl-newspaper3"></div>
        <div>地铁资讯</div>
    </li>
    <li @click="card">
        <div class="iconfont icon-ditie"></div>
        <div>乘车码</div>
    </li>
    <li @click="notice">
        <div class="iconfont icon-gonggao"></div>
        <div>公告</div>
    </li>
    <li @click="found">
        <div class="iconfont icon-dibudaohanglan-"></div>
        <div>失物招领</div>
    </li>
    <li @click="line">
        <div class="iconfont icon-xianlu"></div>
        <div>线路站点</div>
    </li>
    <li @click="record">
        <div class="iconfont icon-shouye"></div>
        <div>乘车记录</div>
    </li>
  </ul>
   
  </div>
</template>

<script>
import {metroswipe} from "./Service"
import mixin from  "@/mixin/flag";
export default {
    data() {
    return {
      list: [],
    };
  },
    mixins:[mixin],
    methods:{
        back(){
            this.$router.go(-1);
        },
        opinion(){
            this.$router.push("/metro_query/opinion");
        },
        info(){
            this.$router.push("/metro_query/info");
        },
        card(){
            this.$router.push("/metro_query/card");
        },
        notice(){
            this.$router.push("/metro_query/notice");
        },
        found(){
            this.$router.push("/metro_query/found");
        },
        line(){
            this.$router.push("/metro_query/line");
        },
        record(){
            this.$router.push("/metro_query/record");
        }
    },
    async created(){
        let res = await metroswipe();
        this.list =res.data.rows
        console.log(res);
    }
}
</script>

<style lang="scss" scoped>
 .my-swipe .van-swipe-item {
    height: 180px;
    color: #fff;
    font-size: 20px;
    line-height: 150px;
    text-align: center;
    background-color: #39a9ed;
  }
  ul{
    width:100%;
    display: flex;
    flex-wrap: wrap;
    padding-top:20px;
    li{
        text-align: center;
        width: 25%;
        font-size:14px;
        height: 80px;
        .iconfont{
            font-size: 26px;
            margin-bottom: 10px;
        }
    }
  }
</style>